home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 1833 < prev    next >
Encoding:
Text File  |  1996-08-06  |  1.7 KB  |  51 lines

  1. Path: news.datasync.com!news
  2. From: drackull@datasync.com (Eddy B Drackull)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Using multiple functions in one file
  5. Date: 13 Jan 1996 06:06:57 GMT
  6. Organization: RK Inspection Service Inc.
  7. Message-ID: <4d7i61$i3e@osh2.datasync.com>
  8. References: <DL00rI.HFr@cunews.carleton.ca>
  9. NNTP-Posting-Host: os-ppp25.datasync.com
  10. X-Newsreader: WinVN 0.92.6
  11.  
  12. In article <DL00rI.HFr@cunews.carleton.ca>, abelo@chat.carleton.ca (Andrew Belo) says:
  13. >
  14. >
  15. >I have written an example program out of a book and it keeps giving me an
  16. >error that says "Call to undefined function 'butler' in function main()" 
  17. >I am using Borland C++ for Dos, Win and Win 32 Version 4.5.
  18. >
  19. >The book is called C: Step by Step, and the program is as follows.
  20.  
  21. try this
  22.  
  23. /* two_func.c -- a program using two functions in one file  */
  24. #include <stdio.h>
  25.  
  26. void butler(void);/*declar a function befor using it*/
  27.                            /*you could switch the order of butler() and main and it will also work*/
  28. main()
  29. {
  30.         printf("I will summon the butler function. \n");
  31.         butler();
  32.         printf("Yes. Bring me some tea and floppy disks.\n");  
  33. }
  34. butler()
  35. {
  36. printf("You rang, sir? \n");
  37. }
  38.  
  39. >----------------------------------------------------------------------------
  40. >Andrew Belo           |  WARNING: Yes this message has spelling mistakes but 
  41. >1st Year Computer Sci |  learn to live with it!!!!!!!!
  42. >Carleton University   ------------------------------------------------------  
  43. >Email address: abelo@chat.carleton.ca
  44. >               ai806@FreeNet.Carleton.CA
  45. >Home Page:     chat.carleton.ca/~abelo
  46. >----------------------------------------------------------------------
  47. >
  48.  
  49.  
  50. bye drackull
  51.